import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import { getUuid } from '@/utils/index'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'workbenches',
    component: () => import('../views/Workbenches'),
    meta: {
      title: '工作台',
      isNav: true,
      id: getUuid()
    }
  },
  {
    path: '/workbenches',
    name: 'workbenches',
    component: () => import('../views/Workbenches'),
    meta: {
      title: '工作台',
      isNav: false,
      id: getUuid()
    }
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/Home'),
    meta: {
      title: '首页',
      isNav: false,
      id: getUuid()
    }
  },
  {
    path: '/graph',
    name: 'graph',
    component: () => import('../views/GraphAlgorithm.vue'),
    meta: {
      title: '图算法',
      isNav: false,
      id: getUuid()
    }
  },
  {
    path: '/ref',
    name: 'red',
    component: () => import('../views/RefView.vue'),
    meta: {
      title: '链表',
      isNav: false,
      id: getUuid()
    }
  },
  {
    path: '/sort',
    name: 'sort',
    component: () => import('../views/MySort'),
    meta: {
      title: '排序',
      isNav: false,
      id: getUuid()
    }
  },
  {
    path: '/PracticeQuestions',
    name: 'PracticeQuestions',
    component: () => import('../views/PracticeQuestions'),
    meta: {
      title: '练习题',
      isNav: false,
      id: getUuid()
    }
  },
  {
    path: '/temp-page',
    name: '/temp-page',
    component: () => import('../views//Temp-page'),
    meta: {
      title: '电子单张',
      isNav: true,
      id: getUuid()
    }
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
